package com.atguigu.gulimall.member.service;

import com.atguigu.gulimall.member.execption.PhoneExistExecption;
import com.atguigu.gulimall.member.execption.UsernameExistExecption;
import com.atguigu.gulimall.member.vo.MemberLoginVo;
import com.atguigu.gulimall.member.vo.MemberRegistVo;
import com.atguigu.gulimall.member.vo.SociaUserVo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.member.entity.MemberEntity;

import java.util.Map;

/**
 * 会员
 *
 * @author shendong
 * @email shendong@gmail.com
 * @date 2020-04-26 10:14:09
 */
public interface MemberService extends IService<MemberEntity> {
    /**
     * 分页查询
     * @param params
     * @return
     */
    PageUtils queryPage(Map<String, Object> params);

    /**
     * 注册
     * @param vo
     */
    void regist(MemberRegistVo vo);

    /**
     * 检查邮箱是否唯一
     * @param phone
     */
    void checkPhoneUnique(String phone) throws PhoneExistExecption;

    /**
     * 检查用户是否唯一
     * @param username
     */
    void checkUserUnique(String username) throws UsernameExistExecption;

    /**
     * 登录
     * @param vo
     * @return
     */
    MemberEntity login(MemberLoginVo vo);

    /**
     * 社交登录
     * @param sociaUserVo
     * @return
     */
    MemberEntity login(SociaUserVo sociaUserVo) throws Exception;
}

